package es.castorm.business.customer.internal.config;

import ma.glasnost.orika.MapperFactory;
import ma.glasnost.orika.metadata.ClassMap;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import es.castorm.arch.mapping.config.EnableBeanMapping;
import es.castorm.business.customer.CustomerDTO;
import es.castorm.business.customer.internal.Customer;

@EnableBeanMapping
@Configuration
public class CustomerMapping {

	@Autowired
	MapperFactory factory;

	@Bean
	public ClassMap<Customer, CustomerDTO> customerClassMap() {
		return factory.classMap(Customer.class, CustomerDTO.class).byDefault().toClassMap();
	}
}
